package com.zlf.blog.dao.mapper;

import com.zlf.blog.dao.pojo.CommentVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zlfi1
 */
@Mapper
public interface CommentMapper {
    /**
     * 查找评论
     * @param bodyId
     * @return
     */
    List<CommentVo> selectComment(@Param("bodyId") String bodyId);

    /**
     * 根据articleId查找userId
     * @param articleId
     * @return
     */
    String selectUserIdByArticleId(@Param("articleId") String articleId);

    /**
     * 添加评论
     * @param commentVo
     * @return
     */
    int addComment(@Param("commentVo") CommentVo commentVo);

    /**
     * 回复评论
     * @param commentVo
     * @return
     */
    int replyComment(CommentVo commentVo);
}
